import java.util.Scanner;

/**
 * @author: gao
 * @create-date: 2025/3/31 10:06
 */

public class Solution {
    public String countAndSay(int n) {
        String ret = "1";//先初始化n=1时的字符串

        for (int i = 1; i < n; i++) {
            StringBuilder tmp = new StringBuilder();
            int len = ret.length();
            for (int left = 0,right = 0;right < len;){
                while(right < len && (ret.charAt(left) == ret.charAt(right))) right++;
                tmp.append(Integer.toString(right - left));
                tmp.append(ret.charAt(left));
                left = right;
            }
            ret = tmp.toString();
        }
        return ret;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNextInt()){
            int n = in.nextInt();
            Solution solution = new Solution();
            System.out.println(solution.countAndSay(n));
        }
    }
}